package com.lianbang.staff.adapter

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
import com.chad.library.adapter.base.entity.SectionEntity
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.lianbang.staff.R
import com.lianbang.staff.bean.ChatListBean

/**
 * Created by maoqi on 2021/1/13.
 */
class ChatListAdapter : BaseMultiItemQuickAdapter<ChatListBean, BaseViewHolder>() {

    init {
        addItemType(1, R.layout.item_chat_receive)
        addItemType(2, R.layout.item_chat_send)
    }

    override fun convert(helper: BaseViewHolder, item: ChatListBean) {
        helper.setText(
            R.id.tv_name, if (item.itemType == 1) "武汉大药房" else "业务员"
        )
            .setText(
                R.id.tv_content,
                "啊？那怎么办啊？那怎么办啊？那怎么办啊？那怎么办啊？那怎么办啊？那怎么办啊？那怎么办啊？那怎么办啊？那怎么办啊？那怎么办啊？那怎么办啊？那怎么办啊？那怎么办"
            )
    }

}